
<?php
//debug($d);
if($result):
?>
<h2><?php echo __('Results') ?></h2>

<?php
echo $this->Form->input('found',array('options'=>$result,'empty'=>'select','label'=>__('Found Users',true)));
?>
<div class="showNextBtn acceptUser"><?php __('Choose'); ?></div>
<?php
else:
?>
<h2><?php echo __('Filter users'); ?></h2>
<?php
echo $this->Form->create(null,array('url'=>'filterUsers/'.$list,'class'=>'filterUsers'));
?> <table><tbody><tr><td> <?php
    echo $this->Form->input('name',array('label'=>__('Name',true)));?> </td><td> <?php
    echo $this->Form->input('surname',array('label'=>__('Surname',true)));?> </td></tr><tr><td> <?php
    echo $this->Form->input('id_code',array('label'=>__('Id Code',true)));?> </td><td> <?php
    echo $this->Form->input('id_erp',array('label'=>__('ERP login',true)));?> </td></tr><tr><td> <?php
    echo $this->Form->input('id_win',array('label'=>__('Windows login',true)));?> </td><td> <?php
    echo $this->Form->input('id_hr',array('label'=>__('Human Resource identifiant',true)));?> </td></tr><tr><td> <?php
    echo $this->Form->input('mail',array('label'=>__('E-mail',true)));?> </td><td> <?php
    echo $this->Form->input('group_id',array('options'=>$groups,'empty'=>'select','label'=>__('ALWPA Group name',true)));?> </td></tr></tbody></table><?php

echo $this->Form->end('submit');

endif;
?>
<div class="isHidden" id="List"><?php  echo $list ?></div>